"""add DoctorAbsent model

Revision ID: ab9cfa002883
Revises: f1ebd8bfc8f4
Create Date: 2024-06-22 15:05:00.064448

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'ab9cfa002883'
down_revision: Union[str, None] = 'f1ebd8bfc8f4'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('doctor_absent',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('id_doctor', sa.Integer(), nullable=True),
    sa.Column('reason', sa.String(), nullable=True),
    sa.Column('start_absent', sa.Date(), nullable=True),
    sa.Column('quantity_days', sa.Integer(), nullable=True),
    sa.Column('viewed', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['id_doctor'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_doctor_absent_id'), 'doctor_absent', ['id'], unique=False)
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_doctor_absent_id'), table_name='doctor_absent')
    op.drop_table('doctor_absent')
    # ### end Alembic commands ###
